<!DOCTYPE html>
<html lang="en">
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="https://cdn.tailwindcss.com"></script>
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css" rel="stylesheet">
    <title>航班管理系统首页 - 轮播图与航班信息</title>
    <style>
        /* 轮播图样式 */
        .slider {
            position: relative;
            width: 100%;
            height: 900px;
            overflow: hidden;
        }

        .slide {
            position: absolute;
            width: 100%;
            height: 100%;
            opacity: 0;
            transition: opacity 0.5s ease-in-out;
        }

        .slide.active {
            opacity: 1;
        }
    </style>
</head>

<body class="bg-gray-100">
<iframe src="../Userframe/top.html" frameborder="0" style="width: 100%; height: 100px;"></iframe>
<!-- 轮播图 -->
<div class="slider">
    <div class="slide active">
        <img src="../static/img/lunbo/ruolan1.webp" alt="航班图片1" class="w-full h-full object-cover">
    </div>
    <div class="slide">
        <img src="../static/img/lunbo/ruolan2.webp" alt="航班图片2" class="w-full h-full object-cover">
    </div>
    <div class="slide">
        <img src="../static/img/lunbo/ruolna3.webp" alt="航班图片3" class="w-full h-full object-cover">
    </div>
</div>
<!-- 假航班信息 -->
<div class="container mx-auto p-8">
    <h2 class="text-2xl font-bold mb-4">热门航班信息</h2>
    <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
        <div class="bg-white p-4 rounded-md shadow-md">
            <h3 class="text-lg font-semibold">航班号: CA123</h3>
            <p>出发地: 北京</p>
            <p>目的地: 上海</p>
            <p>出发时间: 2025-05-01 09:00</p>
            <p>到达时间: 2025-05-01 11:00</p>
        </div>
        <div class="bg-white p-4 rounded-md shadow-md">
            <h3 class="text-lg font-semibold">航班号: MU234</h3>
            <p>出发地: 上海</p>
            <p>目的地: 广州</p>
            <p>出发时间: 2025-05-02 14:00</p>
            <p>到达时间: 2025-05-02 16:00</p>
        </div>
        <div class="bg-white p-4 rounded-md shadow-md">
            <h3 class="text-lg font-semibold">航班号: CZ345</h3>
            <p>出发地: 广州</p>
            <p>目的地: 成都</p>
            <p>出发时间: 2025-05-03 10:30</p>
            <p>到达时间: 2025-05-03 12:30</p>
        </div>
    </div>
</div>
<script>
    // 轮播图切换逻辑
    const slides = document.querySelectorAll('.slide');
    let currentSlide = 0;

    function showSlide(index) {
        slides.forEach((slide, i) => {
            if (i === index) {
                slide.classList.add('active');
            } else {
                slide.classList.remove('active');
            }
        });
    }

    function nextSlide() {
        currentSlide = (currentSlide + 1) % slides.length;
        showSlide(currentSlide);
    }

    setInterval(nextSlide, 3000);
</script>
</body>

</html>
